package bookExercise;

import java.io.*;

public class A18Reader {
    public static void main(String[] args) {
        File f = new File("D:\\aaa.txt");
        try {
            FileWriter fw = new FileWriter(f);
            String word ="春风得意马蹄疾，一日看尽长安花";
            fw.write(word);
            fw.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        try {
            FileReader fr = new FileReader(f);
            char[] ch =new char[1024];
            int len =  fr.read(ch);
           System.out.println("文件中的信息是："+new String(ch,0,len));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
